﻿using DevExpress.Mvvm;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Input;
using TestingApp.Pages.Admin;
using TestingApp.Services;

namespace TestingApp.ViewModels {
    public class TeacherLoginPageViewModel : BindableBase {

        private readonly PageService _navigation;

        public string Password { get; set; }

        public TeacherLoginPageViewModel(PageService navigation) {
            _navigation = navigation;
        }

        public ICommand Login => new DelegateCommand(() => {

            if (Password == "admin") {
                _navigation.Navigate(new AdminPage());
            }else {
                MessageBox.Show("Неверный пароль!");
            }       
        }, ()=> !string.IsNullOrWhiteSpace(Password));
        
    }
}
